package com.haisen.service.impl;

import com.haisen.core.utils.RegexUtil;
import com.haisen.dataobject.entity.JobVerifyCode;
import com.haisen.dataobject.entity.JobVerifyCodeTemp;
import com.haisen.dataobject.mapper.base.JobNoMapper;
import com.haisen.dataobject.mapper.base.JobScheduleMapper;
import com.haisen.dataobject.mapper.base.JobVerifyCodeTempMapper;
import com.haisen.service.JobVerifyCodeTempService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.weekend.Weekend;
import tk.mybatis.mapper.weekend.WeekendCriteria;

import java.net.CacheRequest;
import java.util.Arrays;
import java.util.List;

@Service
public class JobVerifyCodeTempServiceImp implements JobVerifyCodeTempService {


    @Autowired
    private JobVerifyCodeTempMapper jobVerifyCodeTempMapper;


    @Override
    public void delete(Long[] ids) {
        Weekend<JobVerifyCodeTemp> example = Weekend.of(JobVerifyCodeTemp.class);
        WeekendCriteria<JobVerifyCodeTemp,Object> criteria = example.weekendCriteria();
        criteria.andIn(JobVerifyCodeTemp::getId, Arrays.asList(ids));
        jobVerifyCodeTempMapper.deleteByExample(example);
    }

    @Override
    public List<JobVerifyCodeTemp> loadTop(int top) {
        return jobVerifyCodeTempMapper.selectTop(top);
    }

    //COM52,2019-04-19 08:55:16,106575580010,,[yydbliuyousheng]，短信口令978373，用于您本次登录广东4A网络安全管控平台。请在5分钟内使用。
    @Override
    public List<JobVerifyCode> sendList(JobVerifyCodeTemp jobVerifyCodeTemp) {
            /* List<String> jobNoList = RegexUtil.getStrsInMBracket(jobVerifyCodeTemp.getContent());
             //是短信验证码
             if(jobNoList.size()> 0){

             }*/
        return null;
    }
}
